package com.stuMoneyService;

import com.education.model.StudentModel;
import com.education.service.IStuMoneyService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

/**
 * Created by Administrator on 2017/8/14.
 */

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:spring/spring.xml"})
public class StuMoney{

 private static Logger logger = LogManager.getLogger(StuMoney.class);

    @Autowired
    private IStuMoneyService stuMoneyService;

    @Test
    public void getStuMoney() throws Exception{

       List<StudentModel> stuList =  stuMoneyService.queryStuMoneyById(4);
        logger.info("----学生缴费信息：ID"+4);
        for(StudentModel stum:stuList){

            System.out.println(stum.getStudentName());
            System.out.println("----***////");
            System.out.println(stum.getFirstMoney());
            System.out.println(stum.getFirstMoneyTime());
            System.out.println(stum.getFirstMoneyState());
            logger.info("////****----");
            System.out.println(stum.getSecondMoney());
            System.out.println(stum.getSecondMoneyTime());
            System.out.println(stum.getSecondMoneyState());
         }



    }

}
